package com.zcbl.toolkit.spring;

import org.springframework.context.ApplicationContext;

/**
 * @author he peng
 * @create 2018/5/7 13:18
 * @see
 */
public class ApplicationContextHolder {

    private static ApplicationContext APPLICATION_CONTEXT;

    public static <T> T getBean(Class<T> clazz) {
        return APPLICATION_CONTEXT.getBean(clazz);
    }

    public static void setApplicationContext(ApplicationContext applicationContext) {
        APPLICATION_CONTEXT = applicationContext;
    }

}
